package com.example.springboot_manage.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageHandler {

    /**
     * 页面跳转，Restful风格
     * @param page
     * @return
     */
    @RequestMapping("/{page}")
    public String page(@PathVariable String page){
        System.out.println(page);
        return page;
    }

    @RequestMapping("/login")
    public String toLogin(){
        return "login";
    }


    /**
     * 跳转首页
     * @return
     */
    @RequestMapping("/")
    public String index(){
        return "index";
    }
}
